#ifndef __SYS_TIME
#define __SYS_TIME

#include "Timer.h"

typedef struct _SysTime SysTime;
struct _SysTime
{
        Timer   parent_instance;
        uint8_t hours;
        uint8_t minutes;
        uint8_t seconds;
};

typedef struct _SysTimeAtomic SysTimeAtomic;
struct _SysTimeAtomic
{
        uint8_t hours;
        uint8_t minutes;
        uint8_t seconds;
};

extern SysTime *sys_time_new_from_global(void);
/* 格式化系统时钟到数组 */
extern void sys_time_format_to_array(SysTime *self, char *array);

extern void sys_time_set_now(SysTime *self,
                             uint8_t  hours,
                             uint8_t  minutes,
                             uint8_t  seconds);

extern void sys_time_get_now(SysTime *self, SysTimeAtomic *atomic);

extern bool sys_time_compare_with_atomic(const SysTime *self,
                                         const SysTimeAtomic *atomic);

extern void sys_time_atomic_add_seconds(SysTimeAtomic *atomic,
                                        uint16_t       seconds);

#endif
